Imports System.ComponentModel
Imports System.Web.UI

<ToolboxData("<{0}:SecondSample runat=server></{0}:SecondSample>")> Public Class SecondSample
    Inherits System.Web.UI.WebControls.WebParts.WebPart

    Private _BookTitle As String = "*Holland*"

    Public Overrides ReadOnly Property Verbs() As _
                        WebControls.WebParts.WebPartVerbCollection

        Get
            Dim vrbEnglish As New WebControls.WebParts.WebPartVerb("vrbEnglish", AddressOf Me.SetEnglish)
            Dim vrbFrench As New WebControls.WebParts.WebPartVerb("vrbFrench", AddressOf Me.SetFrench)
            vrbEnglish.Text = "English"
            vrbFrench.Text = "French"

            Dim vrbsLanguage(1) As WebControls.WebParts.WebPartVerb
            vrbsLanguage(0) = vrbFrench
            vrbsLanguage(1) = vrbEnglish
            Dim vrbs As WebControls.WebParts.WebPartVerbCollection
            vrbs = New WebControls.WebParts.WebPartVerbCollection(vrbsLanguage)

            Return vrbs

        End Get
    End Property

    Protected Overrides Sub CreateChildControls()
        Dim lbl As New System.Web.UI.WebControls.Label
        Dim lblBook As New System.Web.UI.WebControls.Label

        Dim tbl As New System.Web.UI.WebControls.Table
        Dim tc(1) As System.Web.UI.WebControls.TableCell
        Dim tr(1) As System.Web.UI.WebControls.TableRow

        tc(0) = New System.Web.UI.WebControls.TableCell
        tc(1) = New System.Web.UI.WebControls.TableCell
        tr(0) = New System.Web.UI.WebControls.TableRow
        tr(1) = New System.Web.UI.WebControls.TableRow
        tr(0).Cells.Add(tc(0))
        tr(1).Cells.Add(tc(1))
        tbl.Rows.Add(tr(0))
        tbl.Rows.Add(tr(1))

        lbl.Text = "Title:"
        lblBook.Text = _BookTitle
        lblBook.Font.Bold = True
        lblBook.BorderColor = System.Drawing.Color.Black
        lblBook.BorderStyle = WebControls.BorderStyle.Solid
        lblBook.BorderWidth = 1

        tc(0).Controls.Add(lbl)
        tc(1).Controls.Add(lblBook)

        Me.Controls.Add(tbl)
    End Sub

    <WebControls.WebParts.WebBrowsable(True)> _
    Property BookTitle() As String
        Get
            Return _BookTitle
        End Get
        Set(ByVal value As String)
            _BookTitle = value
        End Set
    End Property


    Public Sub SetEnglish(ByVal sender As Object, ByVal e As WebControls.WebParts.WebPartEventArgs)

    End Sub

    Public Sub SetFrench(ByVal sender As Object, ByVal e As WebControls.WebParts.WebPartEventArgs)

    End Sub
End Class
